﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include "GmStructureFamily.h"

#define ExteriorFaceNodeTag 6
#define InteriorFaceNodeTag 4
#define StartTipFaceNodeTag 1 // 墙的起始端面
#define EndTipFaceNodeTag 2   // 墙的终止端面

namespace gfam
{
    class IFamilyManager;
}

namespace gcmp
{
    class IDocument;
    class IPolyCurve;

    class GM_STRUCTURE_FAMILY_EXPORT BuiltInStructureFamilies
    {
    public:
        typedef std::function<std::wstring(const std::wstring&)> FamilyCreator;

        // CreateBuiltInXXXFamilyDocument()系列函数接收族名字作为参数，返回创建出的族文件的全路径。
        // 如果失败则返回空wstring
        static std::wstring CreateBuiltInWallFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateBuiltInVariableSectionWallFamilyDocument(const std::wstring& familyName);

        static std::wstring CreateBuiltInRectBeamFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateBuiltInVariableSectionRectBeamFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateCustomizedProfileBeamFamilyDocument(const std::wstring& familyName, const IPolyCurve* pLoop);

        static std::wstring CreateBuildInRectangleColumnFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateBuildInCircleColumnFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateCustomizedProfileColumnFamilyDocument(const std::wstring& familyNameconst,const IPolyCurve* pLoop);

        static std::wstring CreateBuiltInFloorFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateBuiltInRaftFoundationFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateBuiltInRoofFamilyDocument(const std::wstring& familyName);

        //创建条形基础(矩形截面)
        static std::wstring CreateBuiltInRectStripFoundationFamilyDocument(const std::wstring& familyName);
        //创建条形基础(T形截面)
        static std::wstring CreateBuiltInTStripFoundationFamilyDocument(const std::wstring& familyName);

        static std::wstring CreateBuiltInRectWallHoleFamilyDocument(const std::wstring& familyName);
        static std::wstring CreateBuiltInCircleWallHoleFamilyDocument(const std::wstring& familyName);

        static std::wstring CreateBuiltInPlateHoleFamilyDocument(const std::wstring& familyName);

    public:
        static void AddWallType(IDocument* pDoc, const std::wstring& typeName, double dWidth);

        static void AddRectangleColumnType(IDocument* pDoc, const std::wstring& typeName, double dColumnProfileWidth, double dColumnProfileHeight);
        static void AddCircleColumnType(IDocument* pDoc, const std::wstring& typeName, double diameter);
        static void AddCustomizedColumnType(IDocument* pDoc, const std::wstring& typeName, const IPolyCurve* pLoop);
        static bool AddFloorType(IDocument* pDoc, const std::wstring& familyType, double thickness);
        static bool AddRoofType(IDocument* pDoc, const std::wstring& familyType, double thickness);
        static bool AddRaftFoundationType(IDocument* pDoc, const std::wstring& familyType, double thickness);
        static bool AddRectWallHoleType(IDocument* pDoc, const std::wstring& familyType, double profileWidth, double profileHeight);
        static bool AddRectBeamType(IDocument* pDoc, const std::wstring& familyType, double profileWidth, double profileHeight);
        static void AddCustomizedBeamType(IDocument* pDoc, const std::wstring& typeName, const IPolyCurve* pLoop);
        static bool AddRectStripFoundationType(IDocument* pDoc, const std::wstring& familyType, double profileWidth, double profileHeight);

    };
}




